package cn.yinyu.queue.module.ecg.enums;

import cn.yinyu.queue.framework.common.core.IntArrayValuable;
import lombok.AllArgsConstructor;
import lombok.Getter;

import java.util.Arrays;

/**
 * 通用状态枚举
 *
 * @author 垠域源码
 */
@Getter
@AllArgsConstructor
public enum QueueStatusEnum implements IntArrayValuable {

    PASSED_WAITING(3, "已过号-排队中"),
    PASSED(5, "已过号"),
    PASSED_INSTALL(7, "已过号-安装"),
    WAITING(10, "排队中"),
    AFFINITY_WAITING(12, "已亲和-排队中"),
    AFFINITY_RECEIVED(13, "已亲和-已领用"),
    RECALLED(15, "已召回"),
    RECALLED_INSTALL(17, "已召回-安装"),
    READY(20, "候诊中"),
    ONSTAGE(30, "就诊中"),  // 或 领用中
    RECEIVED(33, "已领用"),
    INSTALLING(36, "安装中"),
    FINISH(40, "已就诊");

    public static final int[] ARRAYS = Arrays.stream(values()).mapToInt(QueueStatusEnum::getStatus).toArray();

    /**
     * 状态值
     */
    private final Integer status;
    /**
     * 状态名
     */
    private final String name;

    @Override
    public int[] array() {
        return ARRAYS;
    }

/*
    public static boolean isEnable(Integer status) {
        return ObjUtil.equal(ENABLE.status, status);
    }

    public static boolean isDisable(Integer status) {
        return ObjUtil.equal(DISABLE.status, status);
    }
*/

}
